# coding: utf-8

from typing import Sequence
from .Graph import vertex_t


class UVEdge:
    u: vertex_t
    v: vertex_t

    def __init__(self, u: vertex_t, v: vertex_t) -> None:
        self.u = u
        self.v = v

    def __eq__(self, other: object) -> bool:
        return self.v == other.v and self.u == other.u

    def __ne__(self, other: object) -> bool:
        return self.v != other.v or self.u != other.u

    def __str__(self):
        return f"({self.u},{self.v})"

    def reversed(self) -> "UVEdge":
        return UVEdge(self.v, self.u)


"""
Edge which crosses several layers and had to by split into multiple "subedges".
"""


class LongEdge:
    orig: UVEdge
    path: Sequence[vertex_t]

    def __init__(self, orig: UVEdge, path: Sequence[vertex_t]):
        self.orig = orig
        self.path = path
